package com.muyi.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyi.mapper.AccountMapper;
import com.muyi.pojo.entity.Account;
import com.muyi.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 33086
* @description 针对表【account】的数据库操作Service实现
* @createDate 2025-07-17 13:44:25
*/
@Service
public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account>
        implements AccountService {

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public List<Account> list() {
        return accountMapper.list();
    }

    @Override
    public void delete(Integer id) {
        accountMapper.deleteById(id);
    }

    @Override
    public void add(Account account) {
        accountMapper.insertAll(account);
    }

    @Override
    public void update(Account account) {
        accountMapper.update(account);
    }

    @Override
    public Account getByAccountId(Integer account_id) {
        return accountMapper.getByAccountId(account_id);
    }

    @Override
    public Account login(Account account) {
        return accountMapper.getByAccountnameAndPassword(account);
    }



}




